#include"processbar.h"

void processbar()
{
	char buf[NUM];
	memset(buf, '\0', sizeof(buf));
	const char* str = "/-\\|";	
	
	int cnt = 0;
	int len = strlen(str);
	while(cnt <= 100)
	{
		printf("[%-100s][%d%%][%c]\r", buf, cnt, str[cnt % len]);
		fflush(stdout);
		buf[cnt++] = BODY;
		if(cnt < 100) buf[cnt] = RIGHT;
		usleep(60000);
	}
	printf("\n");
}
